]> dgit.raspbian.org Git - grub2.git/commit
efi/peimage: Provide an implementation of load_image, start_image, unload_image
authorJulian Andres Klode <julian.klode@canonical.com>
Mon, 24 Jul 2023 13:26:10 +0000 (15:26 +0200)
committerSteve McIntyre <93sam@debian.org>
Wed, 23 Sep 2026 20:39:45 +0000 (21:39 +0100)
commit4ae89f2d3327884564eee28e2094c8a2e0bf0c18
tree1a9d9a357f3b8298a6f1d2dd07b3860b383ddf8f
parentf3ff0e228d0d499880709607722dac856a3940f7
efi/peimage: Provide an implementation of load_image, start_image, unload_image

The code consumes a PE-COFF image loaded into memory. The functions

* check validity of header
* copy the sections
* relocate the code
* set memory attributes
* invalidate the instruction cache
* execute the image
* return to caller

Caveats:

- We do not always check for over and underflows, but at the
  point we reach this loader, the file has been verified by
  shim already, so this is not much of a concern.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Julian Andres Klode <julian.klode@canonical.com>
Signed-off-by: Mate Kukri <mate.kukri@canonical.com>
Gbp-Pq: Topic secure-boot
Gbp-Pq: Name efi-peimage.patch
grub-core/Makefile.core.def
grub-core/loader/efi/peimage.c [new file with mode: 0644]
include/grub/efi/peimage.h [new file with mode: 0644]